#light
#load "FsUnit.fs"

open System
open FsUnit



module Anagram =
    let key (w: string) =
        w
        |> Seq.map (fun c -> Char.ToUpperInvariant(c))
        |> Seq.orderBy (fun x -> x)
        |> Seq.to_list
        |> List.to_seq

        

spec "No anagrams are found in an empty list."
    (Anagram.find [] |> should (have 0 "anagrams"))

spec "In a list with a single word, no anagrams are found."
    (Anagram.find ["pet"] |> should have 0 "sets of anagrams")

spec "In a two-word list where the words are not anagrams, no anagrams are found."
    (Anagram.find ["pet";"top"] |> should have 0 "sets of anagrams")

spec "In a two-word list where the words are anagrams, one set of anagrams is found."
    (Anagram.find ["pot";"top"] |> should have 1 "set of anagrams")
    
print_endline (results.Summarize())
